package com.alax.interfaces.domain;

import javax.validation.constraints.NotNull;
import java.util.Map;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * API调用请求对象
 *
 * @author alax
 */
@ApiModel(description = "API调用请求对象")
public class ApiCallRequest {
    
    /**
     * API ID
     */
    @ApiModelProperty(value = "API ID", required = true, example = "1")
    @NotNull(message = "API ID不能为空")
    private Long apiId;
    
    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID", required = true, example = "1")
    @NotNull(message = "用户ID不能为空")
    private Long userId;
    
    /**
     * 请求参数
     */
    @ApiModelProperty(value = "请求参数", example = "{\"type\":\"pc\",\"return\":\"json\"}")
    private Map<String, Object> params;
    
    // 认证相关字段
    private String accessKey;      // API访问密钥
    private String signature;      // 请求签名
    private Long timestamp;        // 请求时间戳
    private String nonce;          // 随机字符串，防重放
    
    public Long getApiId() {
        return apiId;
    }
    
    public void setApiId(Long apiId) {
        this.apiId = apiId;
    }
    
    public Long getUserId() {
        return userId;
    }
    
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public Map<String, Object> getParams() {
        return params;
    }
    
    public void setParams(Map<String, Object> params) {
        this.params = params;
    }
    
    public String getAccessKey() {
        return accessKey;
    }
    
    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }
    
    public String getSignature() {
        return signature;
    }
    
    public void setSignature(String signature) {
        this.signature = signature;
    }
    
    public Long getTimestamp() {
        return timestamp;
    }
    
    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }
    
    public String getNonce() {
        return nonce;
    }
    
    public void setNonce(String nonce) {
        this.nonce = nonce;
    }
    
    @Override
    public String toString() {
        return "ApiCallRequest{" +
                "apiId=" + apiId +
                ", userId=" + userId +
                ", params=" + params +
                ", accessKey=" + accessKey +
                ", signature=" + signature +
                ", timestamp=" + timestamp +
                ", nonce=" + nonce +
                '}';
    }
} 